all: compile

clean:
	rm -rf dist/
	rm -rf assemble/
	mkdir -p assemble/html
	mkdir -p dist
	mkdir dist/css

resource: 
	# i don't want to always include the resources, sometimes these can
	# be bigger files
	mkdir -p dist/resource/tools
	cp -uRf src/resource/*.pdf dist/resource
	cp -uRf src/resource/*.gif dist/resource
	cp -uRf src/resource/*.jpg dist/resource
	cp -uRf src/resource/*.png dist/resource
	cp -uRf src/resource/tools/* dist/resource/tools/

compile: 
	cp -Rf src/html/* dist
	m4 src/css/style.css > dist/css/style.css
	m4 src/css/print.css > dist/css/print.css
	m4 src/html/header.html > assemble/html/header.html
	m4 src/html/footer.html > assemble/html/footer.html
	txt2tags -t html --no-headers src/text/*.t2t 
	#txt2tags -t html --toc --no-headers src/text/*.t2t 
	mv src/text/*.html dist

dist: clean resource compile
	tar -cvf neidetcher.com.tar dist/
	gzip neidetcher.com.tar

deploy: compile
	scp -r dist/* demian@neidetcher.com:~/neidetcher_com

spell:
	aspell check src/text/*.t2t

